package cn.wizzer.app.user.modules.models.enums;

import cn.wizzer.framework.util.Result;

import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * -1:取消0:待确认1:待到账2:成功3:失败
 */
public enum WithdrawStatusEnum {
    // 订单、订单详情状态
    CANCELLED("取消", -1),
    APPLYING("申请中", 0),
    PENDING_BANK("待银行到账", 1),
    SUCCESS("提现成功", 2),
    FAIL("提现失败", 3),
    ;

    final public String NAME;
    final public int VALUE;

    WithdrawStatusEnum(String name, int value) {
        NAME = name;
        VALUE = value;
    }

    public String getName() {
        return NAME;
    }

    public int getValue() {
        return VALUE;
    }


    public static List<Map<Object, Object>> toList(){
        WithdrawStatusEnum[] values = WithdrawStatusEnum.values();
        return Arrays.stream(values).map(enu -> Result.createHashMap("name", enu.NAME, "value", enu.toString()))
                .collect(Collectors.toList());
    }
}
